package STUDENT.TRINHQUANGXUANDUC.OPPS.baitapmang.bai2;

public class Models {
	public static int average(int[] array) {
		int diemtb = 0;
		int sopt = 0;
		int tongsohang = 0;
		for (int i = 0; i < array.length; i++) {
			if (array[i] > 0) {
				tongsohang = array[i];
				tongsohang += tongsohang;
				sopt++;
			}

		}
		diemtb = tongsohang / sopt;
		return diemtb;
	}

	public static double average(double[] array) {
		double diemtb = 0;
		double sopt = 0;
		double tongsohang = 0;
		for (int i = 0; i < array.length; i++) {
			if (array[i] > 0) {
				tongsohang = array[i];
				tongsohang += tongsohang;
				sopt++;
			}
		}
		diemtb = tongsohang / sopt;
		return diemtb;
	}

}
